<%-- 
    Document   : profile
    Created on : Nov 23, 2009, 4:38:41 PM
    Author     : brian
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="helpdesk.User" %>

<%!
    String error;

    User user;

    String email;
    String firstName;
    String lastName;
    String phoneNumber;
    String address;
    String zip;
    String support;

%>

<%
    user = (User)session.getAttribute("user");
    email = user.getEmail();
    firstName = user.getFirstName();
    lastName = user.getLastName();
    phoneNumber = user.getPhoneNumber();
    address = user.getAddress();
    zip = user.getZip();
    if (user.getSupport())
        support="checked";
    else
        support="";

    error = (String)request.getAttribute("error");
    if (error == null)
        error = "";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <%@include file="headtags.html"%>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Profile</title>
    </head>
    <body>
        <%@include file="menu.html"%>
        <%= error %>
        <table class="content" width ="100%"><tr class="heading"><td align="center">My Profile</td></tr><tr><td>
                    <form name="profile_form" method="post" action="profile.jsp">
                    <table>
                        <tr>
                            <td>Email</td>
                            <td><input type="text" name="email" value="<%= email %>" /></td>
                        </tr>
                        <tr>
                            <td>First Name</td>
                            <td><input type="text" name="firstName" value="<%= firstName %>" /></td>
                        </tr>
                        <tr>
                            <td>Last Name</td>
                            <td><input type="text" name="lastName" value="<%= lastName %>" /></td>
                        </tr>
                                                <tr>
                            <td>Phone Number</td>
                            <td><input type="text" name="phoneNumber" value="<%= phoneNumber %>" /></td>
                        </tr>
                                                <tr>
                            <td>Address</td>
                            <td><input type="text" name="address" value="<%= address %>" /></td>
                        </tr>
                                                <tr>
                            <td>Zipcode</td>
                            <td><input type="text" name="zip" value="<%= zip %>" /></td>
                        </tr>
                                                <tr>
                            <td>Password</td>
                            <td><input type="password" name="pass1" value="" /></td>
                        </tr>
                                                <tr>
                            <td>Confirm Password</td>
                            <td><input type="password" name="pass2" value="" /></td>
                        </tr>
                        <tr>
                            <td>Support</td>
                            <td><input type="checkbox" name="support" <%= support %> /></td>
                        </tr>
                        <tr>
                            <td colspan="2"><input type="submit" value="Update Profile" /></td>
                        </tr>
       </table></form>
            </td></tr></table>
    </body>
</html>
